<template>
<view >
  <view class="menu flex a-item" :class="{'clickMenu':selectIndex === index}" v-for="(item,index) in types" @tap="emit(item,index)">{{ item.name }}</view>
  <view class="menu" style="height: 300rpx;width: 100%"></view>
</view>
</template>

<script>
export default {
  name: "typeMenu",
  props:{
    types:{
      type: Array,
      default: []
    },
    selectIndex:{
      type: Number,
      default: -1
    },
  },
  data(){
    return{
    }
},
  methods:{
    emit(val,index){
      this.$emit('update:selectIndex',index)
      this.$emit('change',val)
    }
  }

}
</script>

<style scoped>
.menu{
  font-size: 28rpx;
  height: 100rpx;
  padding-left: 20rpx;
  background-color: #ffffff;
  color: #666666;
  font-family: PingFangSC;
}
.clickMenu{
  background-color: rgb(240,240,240)!important;
  color: #000000;
  font-size: 32rpx;
}
</style>
